import os
from bottle import run as _run
from bottle import route, view, static_file
from mamba import home, video, media, dvd, tv, system
import mamba.config as config

@route("/lib/<filepath:path>")
def lib(filepath):
	return static_file(filepath, root="lib")

@route("/views/<filepath:path>")
def viewfile(filepath):
	return static_file(filepath, root="views")


@route("/")
@view("index")
def index():
	return dict()	

@route("/css")
@view("css")
def css():
	return dict(transition_duration = 0.1)

def run():
	port = config.config().getint("server", "port", fallback=9985)
	_run(host="localhost", port=port, reloader=True, server="cherrypy")
